<?php

namespace Dao\Db\Order;

use Dao\Db;

class Test extends Db {

    const TABLE = 'test';

    public function doTest($query) {
        return self::db()->queryone(self::TABLE, $query);
    }

    public function getOne($query) {
        return self::db()->queryone(self::TABLE, $query);
    }

    public function add($data) {
        self::db()->insert(self::TABLE, $data);
        return self::db()->lastInsertId();
    }

    public function update($data, $condition) {
        return self::db()->update(self::TABLE, $data, $condition);
    }

    public function getList($query, $con, $order, $limit) {
        return self::db()->query(self::TABLE, $query, $con, $order, $limit);
    }

    public function queryAll($query) {
        return self::db()->query(self::TABLE, $query);
    }

    public function getCount($query) {
        return self::db()->count(self::TABLE, $query);
    }
}
